<template>
  <div class="box-list-container">
    <div class="box-query-form">
      <el-form :model="queryParam" label-width="auto" label-position="right" :gutter="24">
        <el-row>
          <el-col :xl="6" :lg="6" :md="12" :sm="24">
            <el-form-item label="检测位置:">
              <selectWisdomCommunity v-model="queryParam.oldCommunityNo" :select-one="true" @selectOne="selectOne" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
  </div>
</template>

<script>

/*

下拉框组件里面的代码,主要是33~42行

// 获取列表
getList(name, isInit) {
  this.loading = true
  const url = '/old/oldCommunity/listPage'
  postAction(url, { pageNum: 1, pageSize: 50, oldCommunityName: name, ...this.param }).then(res => {
    if (res.status === 0) {
      this.list = res.data.list || []
      if (isInit) {
        this.allList = res.data.list || []
      }
      // 如果启用了默认选择第一项，并且有数据
      if (this.selectOne && this.list.length > 0) {
        const firstItem = this.list[0]
        // 防止重复触发
        if (this.modelValue !== firstItem.oldCommunityNo) {
          this.$emit('change', firstItem.oldCommunityNo)
          // 可选：同时触发 getRowInfo
          this.$emit('selectOne', firstItem)
        }
      }
      this.loading = false
    }
  }).finally(() => {
    this.loading = false
  })
},
*/
import { listMixin } from '@/mixins/listMixin'
import selectWisdomCommunity from '@/components/xm/selectWisdomCommunity'

export default {
  components: {
    selectWisdomCommunity
  },
  mixins: [listMixin],
  data() {
    return {
      physicalNo: 'id',
      oldCommunityNo: '',
      toggleSearchStatus: false,
      disableMixinCreated: true,
      url: {
        list: '/httpPost/yitiji/listPage',
        deleteBatch: ''
      }
    }
  },
  created() {},
  mounted() {},
  methods: {
    // 重置
    searchReset() {
      this.queryParam = {
        oldCommunityNo: this.oldCommunityNo
      }
      this.loadData(1)
    },
    selectOne(obj) {
      this.oldCommunityNo = obj.oldCommunityNo
      this.loadData(1)
    }
  }
}
</script>

<style lang="scss" scoped>
</style>

